package com.xdjj.market.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdjj.market.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserDemoMapper extends BaseMapper<User> {
    @Select("select * from t_user where user_name like concat('%',#{userName},'%')")
    List<User> selectByUserNameLike(String userName);

    @Insert("insert into t_user values (#{id},#{userName},#{age})")
    void insertUser(User user);

    @Update("update t_user set user_name = #{userName} ,age = #{age} where id = #{id}")
    void updateUserById(User user);

    @Delete("delete from t_user where id = #{id}")
    void deleteUserById(Integer id);
}
